<template>
  <div>
    <h1>Count</h1>
    <p>电影列表的长度:{{movieList.length}}</p>
    <p>count值:{{count}}</p>
    <p>doubleCount的值:{{doubleCount}}</p>
    <button @click="addCount">累加count</button>
    <button @click="addCountN(3)">count累加n</button>
    <button @click="addCountWaitNM(2,3)">等待2秒累加n和m</button>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";
export default defineComponent({
    name:"Count",
})
</script>

<script lang="ts" setup>
import {storeToRefs} from "pinia";
import {useCountState} from "../store/count";
import {useMovieState} from "../store/movie";
const movieState = useMovieState()
const {movieList} = storeToRefs(movieState)
const countState = useCountState()
const {count,doubleCount} = storeToRefs(countState)
const {addCount,addCountN,addCountWaitNM} = countState


</script>

<style scoped>
h1{
    background: pink;
}
</style>